<div class="ecatalogue_sorting sort_product">
    <:ecatalogue:sort_by:>:
    <select class="sorting">
        <option><:ecatalogue:not_selected:></option>
        [(#REM) Uncomment sorting by needed fields]
        <option [(#ENV{sort_by}|=={price}|?{ [(#ENV{sort_order}|=={0}|?{ selected })] })] data-url-part="&sort_by=price&sort_order=0"><:ecatalogue:sort_by_price:>: <:ecatalogue:sort_by_price_asc:></option>        
        <option [(#ENV{sort_by}|=={price}|?{ [(#ENV{sort_order}|=={1}|?{ selected })] })] data-url-part="&sort_by=price&sort_order=1"><:ecatalogue:sort_by_price:>: <:ecatalogue:sort_by_price_desc:></option>
        <option [(#ENV{sort_by}|=={titre}|?{ [(#ENV{sort_order}|=={1}|?{ selected })] })] data-url-part="&sort_by=titre&sort_order=0"><:ecatalogue:sort_by_titre:>: <:ecatalogue:sort_by_titre_asc:></option>
        <option [(#ENV{sort_by}|=={titre}|?{ [(#ENV{sort_order}|=={1}|?{ selected })] })] data-url-part="&sort_by=titre&sort_order=1"><:ecatalogue:sort_by_titre:>: <:ecatalogue:sort_by_titre_desc:></option>
        <option [(#ENV{sort_by}|=={sku}|?{ [(#ENV{sort_order}|=={1}|?{ selected })] })] data-url-part="&sort_by=sku&sort_order=0"><:ecatalogue:sort_by_sku:>: <:ecatalogue:sort_by_sku_asc:></option>
        <option [(#ENV{sort_by}|=={sku}|?{ [(#ENV{sort_order}|=={1}|?{ selected })] })] data-url-part="&sort_by=sku&sort_order=1"><:ecatalogue:sort_by_sku:>: <:ecatalogue:sort_by_sku_desc:></option>
    </select>
</div>
<script type="text/javascript">		
$(document).ready(function() {        
    $('.sort_product select.sorting').change(function(){
	    var url = "<?php echo str_replace("amp;", "","[(#SELF|parametre_url{sort_by|sort_order,''})]"); ?>";         
        var url_part = $(this).find('option:selected').attr('data-url-part');
        if (url_part != undefined)
            window.location = url + url_part;
	});
});
</script>